<template>
  <div>
    <div v-if="dialogVisible">
      <el-dialog title="信息确认并提交" :visible.sync="dialogVisible" width="700px">
        <div>
          <div v-for="(item, i) in systemGuifanFilesProcessList" :key="i">
            <div class="mb10">
              <b>
                文件信息
                <span v-if="systemGuifanFilesProcessList.length > 1">({{ i + 1 }})</span>
              </b>
            </div>
            <table class="table1 owntable mb20 tableLayout" border="0" cellspacing="0" cellpadding="1" style="width: 100%;">
              <tr>
                <td width="100">文件名称</td>
                <td>{{ item.name }}</td>
                <td width="100">文件编号</td>
                <td>{{ item.fileNumber }}</td>
                <td width="100">文件版本号</td>
                <td>{{ item.versionNumber }}</td>
              </tr>
              <tr>
                <td>文件控制状态</td>
                <td>{{ item.controlStatus == '0' ? '受控' : '非受控' }}</td>
                <td>内部/外来文件</td>
                <td>{{ item.fileSource == '0' ? '内部文件' : '外来文件' }}</td>
                <td>编制部门</td>
                <td>{{ item.createDeptName }}</td>
              </tr>
            </table>

            <table class="owntable mb20 table1" border="0" cellspacing="0" cellpadding="1" style="width: 100%;" v-if="item.isUpgrade">
              <tr>
                <td width="100">升版原因</td>
                <td class="white_bg">{{ item.reason }}</td>
              </tr>
            </table>

            <table class="owntable mb20 table1" border="0" cellspacing="0" cellpadding="1" style="width: 100%;">
              <tr>
                <td width="100">页码数量</td>
                <td class="white_bg">{{ item.pageCount }}</td>
              </tr>
            </table>

            <table class="mb20 owntable" border="0" cellspacing="0" cellpadding="1">
              <tr>
                <td width="100">文件</td>
                <td class="white_bg w550 flex_between">
                  <span class="main_co pointer" @click="fileTempleteEdit(item)">{{ item.originalName }}</span>
                  <el-button size="mini" v-if="item.isSystemCover == '1'" @click="getFileCover(item,'systemjilufilesprocess')">封面预览</el-button>
                </td>
              </tr>
            </table>
          </div>
          <file-preview-process :guifanFilesProcessRecordList="guifanFilesProcessRecordList"></file-preview-process>
          <div class="pub_center"><el-button size="small" type="primary" @click.once="close()">提交</el-button></div>
        </div>
      </el-dialog>
     <pdf :pdfUrl="src" ref="pdf"></pdf>
    </div>
  </div>
</template>

<script>
import fileMinixs from '@/mixins/file.js';
import filePreviewProcess from '@/components/file-preview-process/index.vue';
import pdf from '@/components/pdf/index.vue';
export default {
  props: {
    type: String,
    guifanFilesProcessRecordList: [],
    systemGuifanFilesProcessList: []
  },
  components: {
    filePreviewProcess,
    pdf
  },
  data() {
    return {
      dialogVisible: false
    };
  },
  mixins: [fileMinixs],
  methods: {
    init() {
      this.dialogVisible = true;
    },
    close() {
      this.$emit('close');
    }
  }
};
</script>

<style scoped="scoped">
.table1 {
  margin-bottom: 20px;
}

table {
  width: 660px;
}
</style>
